import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/home/knownledge/knowledge_base_info_entity.dart';

KnowledgeBaseInfoEntity $KnowledgeBaseInfoEntityFromJson(Map<String, dynamic> json) {
  final KnowledgeBaseInfoEntity knowledgeBaseInfoEntity = KnowledgeBaseInfoEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    knowledgeBaseInfoEntity.id = id;
  }
  final int? typeId = jsonConvert.convert<int>(json['typeId']);
  if (typeId != null) {
    knowledgeBaseInfoEntity.typeId = typeId;
  }
  final String? fileName = jsonConvert.convert<String>(json['fileName']);
  if (fileName != null) {
    knowledgeBaseInfoEntity.fileName = fileName;
  }
  final String? type = jsonConvert.convert<String>(json['type']);
  if (type != null) {
    knowledgeBaseInfoEntity.type = type;
  }
  final String? writingDay = jsonConvert.convert<String>(json['writingDay']);
  if (writingDay != null) {
    knowledgeBaseInfoEntity.writingDay = writingDay;
  }
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    knowledgeBaseInfoEntity.createTime = createTime;
  }
  final String? fileCode = jsonConvert.convert<String>(json['fileCode']);
  if (fileCode != null) {
    knowledgeBaseInfoEntity.fileCode = fileCode;
  }
  final String? fileType = jsonConvert.convert<String>(json['fileType']);
  if (fileType != null) {
    knowledgeBaseInfoEntity.fileType = fileType;
  }
  final String? fileUrl = jsonConvert.convert<String>(json['fileUrl']);
  if (fileUrl != null) {
    knowledgeBaseInfoEntity.fileUrl = fileUrl;
  }
  final int? fileNumber = jsonConvert.convert<int>(json['fileNumber']);
  if (fileNumber != null) {
    knowledgeBaseInfoEntity.fileNumber = fileNumber;
  }
  final int? deptId = jsonConvert.convert<int>(json['deptId']);
  if (deptId != null) {
    knowledgeBaseInfoEntity.deptId = deptId;
  }
  final String? deptName = jsonConvert.convert<String>(json['deptName']);
  if (deptName != null) {
    knowledgeBaseInfoEntity.deptName = deptName;
  }
  final String? fileContent = jsonConvert.convert<String>(json['fileContent']);
  if (fileContent != null) {
    knowledgeBaseInfoEntity.fileContent = fileContent;
  }
  final String? personIntro = jsonConvert.convert<String>(json['personIntro']);
  if (personIntro != null) {
    knowledgeBaseInfoEntity.personIntro = personIntro;
  }
  final String? creator = jsonConvert.convert<String>(json['creator']);
  if (creator != null) {
    knowledgeBaseInfoEntity.creator = creator;
  }
  final String? attributeName = jsonConvert.convert<String>(json['attributeName']);
  if (attributeName != null) {
    knowledgeBaseInfoEntity.attributeName = attributeName;
  }
  final String? attributeCode = jsonConvert.convert<String>(json['attributeCode']);
  if (attributeCode != null) {
    knowledgeBaseInfoEntity.attributeCode = attributeCode;
  }
  return knowledgeBaseInfoEntity;
}

Map<String, dynamic> $KnowledgeBaseInfoEntityToJson(KnowledgeBaseInfoEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['typeId'] = entity.typeId;
  data['fileName'] = entity.fileName;
  data['type'] = entity.type;
  data['writingDay'] = entity.writingDay;
  data['createTime'] = entity.createTime;
  data['fileCode'] = entity.fileCode;
  data['fileType'] = entity.fileType;
  data['fileUrl'] = entity.fileUrl;
  data['fileNumber'] = entity.fileNumber;
  data['deptId'] = entity.deptId;
  data['deptName'] = entity.deptName;
  data['fileContent'] = entity.fileContent;
  data['personIntro'] = entity.personIntro;
  data['creator'] = entity.creator;
  data['attributeName'] = entity.attributeName;
  data['attributeCode'] = entity.attributeCode;
  return data;
}

extension KnowledgeBaseInfoEntityExtension on KnowledgeBaseInfoEntity {
  KnowledgeBaseInfoEntity copyWith({
    int? id,
    int? typeId,
    String? fileName,
    String? type,
    String? writingDay,
    String? createTime,
    String? fileCode,
    String? fileType,
    String? fileUrl,
    int? fileNumber,
    int? deptId,
    String? deptName,
    String? fileContent,
    String? personIntro,
    String? creator,
    String? attributeName,
    String? attributeCode,
  }) {
    return KnowledgeBaseInfoEntity()
      ..id = id ?? this.id
      ..typeId = typeId ?? this.typeId
      ..fileName = fileName ?? this.fileName
      ..type = type ?? this.type
      ..writingDay = writingDay ?? this.writingDay
      ..createTime = createTime ?? this.createTime
      ..fileCode = fileCode ?? this.fileCode
      ..fileType = fileType ?? this.fileType
      ..fileUrl = fileUrl ?? this.fileUrl
      ..fileNumber = fileNumber ?? this.fileNumber
      ..deptId = deptId ?? this.deptId
      ..deptName = deptName ?? this.deptName
      ..fileContent = fileContent ?? this.fileContent
      ..personIntro = personIntro ?? this.personIntro
      ..creator = creator ?? this.creator
      ..attributeName = attributeName ?? this.attributeName
      ..attributeCode = attributeCode ?? this.attributeCode;
  }
}